package com.andy.beef.ui.main.viewmodel

import com.andy.module.ext.genLiveData
import com.andy.module.ext.requestAny
import com.andy.beef.ui.main.api.TradeApiService
import com.andy.beef.ui.main.api.tradeService
import com.andy.network.base.BaseViewModel

/**
 * @creator:LuoFan
 * @date:2022/5/31
 * @description:
 */
class EditFarmCattleViewModel : BaseViewModel() {

    val addResultData = genLiveData<Any>()

    val editResultData = genLiveData<Any>()

    fun addCattle(params: HashMap<String, Any>) {
        requestAny({
            tradeService.postResultAny(TradeApiService.URL_CATTLE_ADD, params)
        }, addResultData)
    }

    fun editCattle(params: HashMap<String, Any>) {
        requestAny({
            tradeService.postResultAny(TradeApiService.URL_CATTLE_EDIT, params)
        }, editResultData)
    }
}